# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-qtpy
_pkgorig=qtpy
pkgver=2.4.1
pkgrel=1
pkgdesc="QtPy: Abstraction layer for PyQt5/PySide2/PyQt6/PySide6"
url="https://github.com/spyder-ide/qtpy"
arch="noarch"
license="MIT"
depends="python3 py3-packaging"
checkdepends="py3-pytest py3-pytest-cov py3-pytest-qt py3-qt5 xvfb-run"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="https://github.com/spyder-ide/qtpy/archive/v$pkgver/$_pkgorig-$pkgver.tar.gz"
builddir="$srcdir/qtpy-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	xvfb-run -a python3 -m pytest -k 'not test_qtlocation and not test_qtpositioning and not test_qtsql and not test_qttexttospeech and not test_qtxmlpatterns and not test_qfontmetrics_width'
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl

	rm -r "$pkgdir"/usr/lib/python3.*/site-packages/qtpy/tests
}

sha512sums="
d5aa6a32f04447a13d3673d3897b0638be42a27e82277133e80b7b2ecf39a034d61625302462000a9742ffc0467f4cf3e2b8b2116df277d87396bbcbde6acbc3  qtpy-2.4.1.tar.gz
"
